Skip to content

TreeSitterQuery: pass utf8 byte count to ts_query_new#419

Open
Bogdanp wants to merge 1 commit intosimonbs:mainfrom
Bogdanp:main
Open

TreeSitterQuery: pass utf8 byte count to ts_query_new#419
Bogdanp wants to merge 1 commit intosimonbs:mainfrom
Bogdanp:main

Conversation

@Bogdanp
Copy link

@Bogdanp Bogdanp commented Mar 11, 2026

Passing the Character count is problematic for query files that contain unicode characters (such as λ or ∀ -- as in 1), because the Character count ends up being shorter than the byte length, leading to truncated patterns (as in the @comment at the end of 1) or invalid syntax.

Passing the Character count is problematic for query fiels that contain
unicode characters (such as λ or ∀ -- as in [1]), because the Character
count ends up being shorter than the byte length, leading to truncated
patterns (as in the @comment at the end of [1]) or invalid syntax.

[1]: https://github.com/6cdh/tree-sitter-racket/blob/56b57807f86aa4ddb14892572b318edd4bc90ebe/queries/highlights.scm#L12
@Bogdanp Bogdanp requested a review from simonbs as a code owner March 11, 2026 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant